package com.zhuang.chapter05.work01;

public class RectMain {

	public static void main(String[] args) {
		Rect rect = new Rect(5, 6);
		rect.getArea();
		rect.getPerimeter();
	}
}

class Rect {
	private int width;

	private int height;

	private int area;

	private int perimeter;

	public Rect(int width, int height) {
		super();
		this.width = width;
		this.height = height;
	}

	public void getArea() {
		area = width * height;
		System.out.println("矩形的面积是：" + area);
	}

	public void getPerimeter() {
		perimeter = (width + height) * 2;
		System.out.println("矩形的周长是：" + perimeter);
	}
}